package com.inno.subject.common.enums;

import lombok.Getter;

/**
 * @author shenzeyang
 */
@Getter
public enum MemberTypeEnum {
    /**
            * 会员类型 0-日付会员 1-月付会员 2-年付会员 3-永久会员
     */
    DAY("0", "日付会员"),
    MONTH("1", "月付会员"),
    YEAR("2", "年付会员"),
    FOREVER("3", "永久会员");

    private final String code;
    private final String desc;

    MemberTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static MemberTypeEnum getEnum(String code) {
        for (MemberTypeEnum memberTypeEnum : values()) {
            if (memberTypeEnum.getCode().equals(code)) {
                return memberTypeEnum;
            }
        }
        return null;
    }
}
